package com.boost.tjvm.gc;


public class YangBigHeap {

    public static void main(String[] args) throws Exception {
       String[] strArray={" 1 " ," 2 "," 3 "};
        for(int i=0;i<1000033333;i++){
            for (String str:strArray) {
                if(i%10000 == 0){
                    Thread.sleep(1000);
                }
                str.trim();
            }
        }
    }



    public static void stringPlus() throws Exception{

        Thread t =new Thread(()->{
            String s=new String();
            for (int i =0;i<100000000;i++){
                s = s + i;
                if(i%10000 == 0){
                    try {
                        Thread.sleep(1000);
                        System.out.println("累了睡一会");
                    }catch (Exception e){
                    }
                }
            }

        });
        t.start();
        Thread.sleep(1000000);
    }
}
